/*
 * Physics.h
 *
 *  Created on: 05/05/2011
 *      Author: Rafael
 */

#ifndef PHYSICS_H_
#define PHYSICS_H_

/**
 *\note singleton
 */

#include "ObjectManager.h"
#include "core/MapManager.h"


class Physics {
private:
	static Physics* s_instance;
	Physics();

	void onTurnCollide(Model *model, Model *otherModel);
	void onCollide(Model *model, Model *otherModel, Point2D *newPos);
	void onSrike(GameObject *obj, GameObject *otherObj, Point2D step);

	Dialog *dialog;
	MapManager *scenery;
public:
	ObjectManager *ObjMg;

	virtual ~Physics();
	static Physics* Instance();
	void Init(ObjectManager *ObjMg, MapManager *scenery, Dialog *dialog = NULL);
	void Quit();
	bool onMove(int objID);
	void onMove(int objID, Point2D step);
	void onTurn(int objID);
	void onTurn(int objID, EnumDirection dir);
	void onAttack(int objID);
	void onShoot(int objID);
	void onInteract(int objID);
	bool onTryInteract(int objID);
	Map* getMap();
};

#endif /* PHYSICS_H_ */
